﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Checkout.aspx.cs" Inherits="WebApplication1.Checkout" MasterPageFile="~/masterpage/User.Master" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <script src="js/prettify.js"></script>
    <script type="text/javascript" src="js/moment.js"></script>
    <script type="text/javascript" src="js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="js/ru.js"></script>


    <%--Begin Loading ajax section--%>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
        <ProgressTemplate>
            <div style="position: fixed; text-align: center; height: 100%; width: 100%; top: 0; right: 0; left: 0; z-index: 9999999; background-color: #000000; opacity: 0.7;">
                <div class="center">

                    <img alt="" src="images/loading.gif" />
                </div>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <%--End Loading ajax section--%>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div runat="server" id="orderPanel" class="container-fluid">

                <fieldset>
                    <legend>Check Out Orders</legend>
                </fieldset>
                <div class="control-group col-md-12">
                    <!-- Alert Message -->
                    <asp:Panel ID="divMessage" runat="server" class="alert alert-danger  alert-dismissible" Visible="False" role="alert">
                        <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <asp:Label ID="lblMessage" runat="server" Text="">
                         
                        </asp:Label>
                    </asp:Panel>
                    <label class="control-label"></label>
                    <asp:ListView ID="lsvCart" runat="server" OnItemDataBound="lsvCart_DataBound" OnPreRender="lsvCart_PreRender" OnItemCommand="lsvCart_ItemCommand">
                        <EmptyDataTemplate>
                        </EmptyDataTemplate>
                        <LayoutTemplate>
                            <table id="itemPlaceholderContainer" runat="server" border="0" style="" class="table table-hover table-bordered">
                                <tr runat="server" style="">

                                    <th runat="server">Food    
                                        <asp:Label ID="lblName" runat="server" Text=""></asp:Label></th>
                                    <th runat="server">Condiment</th>
                                    <th runat="server">Price ($)</th>
                                    <th runat="server">Quantity</th>
                                    <th runat="server">Sub total ($)</th>
                                    <th runat="server"></th>

                                </tr>
                                <tr id="itemPlaceholder" runat="server">
                                </tr>
                                <tr runat="server">
                                    <td colspan="2">
                                        <b>Total ($)</b>
                                    </td>
                                    <td colspan="4">
                                        <asp:Label runat="server" ID="lblTotal" Text=""></asp:Label>
                                    </td>
                                </tr>
                                <tr runat="server">
                                    <td colspan="6">Pickup date & time: 
                                        <div class="input-group" id="datetimepicker7">
                                            <span class="input-group-addon datepickerbutton">
                                                <span class="glyphicon glyphicon-calendar"></span>
                                            </span>
                                            <asp:TextBox runat="server" class="form-control" ID="dpdPick" ClientIDMode="Static" />

                                        </div>

                                    </td>
                                </tr>
                                <tr runat="server">
                                    <td colspan="6">Remarks:
                                          <asp:TextBox runat="server" class="form-control" ID="txtRemarks" ClientIDMode="Static" TextMode="MultiLine" ToolTip="Order remark" MaxLength="199" />
                                    </td>
                                </tr>
                                <tr runat="server">
                                    <td colspan="6">
                                        <asp:Button runat="server" ID="btnConfirm" Text="Confirm" class="btn btn-primary" OnClick="btnConfirm_Click" />
                                    </td>
                                </tr>
                            </table>
                        </LayoutTemplate>

                        <ItemTemplate>
                            <tr style="">
                                <td>
                                    <asp:Label ID="lblName" runat="server" Text='<%# Eval("Name") %>' />
                                </td>
                                <td>
                                    <asp:Label ID="lblCondiment" runat="server" Text='<%# Eval("Condiment") %>' />
                                </td>
                                <td>
                                    <asp:Label ID="lblPrice" runat="server" Text='<%# Eval("Price") %>' />
                                </td>
                                <td>
                                    <asp:Label ID="lblQuantity" runat="server" Text='<%# Eval("Quantity") %>' />
                                </td>

                                <td>
                                    <asp:Label ID="lblSubTotal" runat="server" Text='<%# Convert.ToDouble(Eval("Quantity"))*Convert.ToDouble(Eval("Price")) %>' />
                                </td>
                                <td>
                                    <asp:LinkButton ID="btnDelete" runat="server" CommandArgument='<%# Eval("FoodId") %>' CommandName="CancelItem">[x]</asp:LinkButton>


                                </td>
                        </ItemTemplate>
                    </asp:ListView>
                </div>



                <script>



                    $(function () {
                        var nowTemp = new Date();
                        var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);
                        $('#dpdPick').datetimepicker({

                            minDate: now,
                            minuteStepping: 30

                        });
                    });


                </script>
            </div>

        </ContentTemplate>
    </asp:UpdatePanel>

</asp:Content>

